#pragma once

#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <assert.h>

typedef int HDT;

typedef struct Heap
{
	HDT* a;
	int size;
	int capacity;
}HP;

void HPInit(HP* php);

void HPDestroy(HP* php);

void HPPush(HP* php, HDT x);

void HPPop(HP* php);

HDT HPTop(HP* php);

bool HPEmpty(HP* php);

int HPSize(HP* php);

void AdjustDown(HDT* pa, int size, int parent);

void AdjustUp(HDT* pa, int child);

void Swap(HDT* p1, HDT* p2);